﻿using System;
using QuickDev.Common.Serialization;
namespace QuickDev.Model
{
    /// <summary>
    /// <para>Application Object</para>
    /// </summary>
    [Serializable]
    public class Application
    {
        #region Private Fields
        private int _applicationId;
        private string _name;
        private string _url;
        private string _logo;
        private string _description;
        private int _sequence;
        private int _status;
        private int _totalmembers;
        #endregion

        #region Public Properties

        ///<summary>
        ///ApplicationId
        ///</summary>
        public int ApplicationId
        {
            get { return _applicationId; }
            set { _applicationId = value; }
        }

        ///<summary>
        ///Name
        ///</summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        ///<summary>
        ///Url
        ///</summary>
        public string Url
        {
            get { return _url; }
            set { _url = value; }
        }

        ///<summary>
        ///Logo
        ///</summary>
        public string Logo
        {
            get { return _logo; }
            set { _logo = value; }
        }

        ///<summary>
        ///Description
        ///</summary>
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        ///<summary>
        ///Sequence
        ///</summary>
        public int Sequence
        {
            get { return _sequence; }
            set { _sequence = value; }
        }

        ///<summary>
        ///Status
        ///</summary>
        public int Status
        {
            get { return _status; }
            set { _status = value; }
        }

        ///<summary>
        ///TotalMembers
        ///</summary>
        public int TotalMembers
        {
            get { return _totalmembers; }
            set { _totalmembers = value; }
        }
        #endregion

        #region Serialization Methods

        /// <summary>
        /// News from XML.
        /// </summary>
        /// <param name="xml">The XML.</param>
        /// <returns></returns>
        public object NewFromXml( string xml )
        {
            Serializer serializer = new Serializer();
            return serializer.DeserializeObject( xml, typeof( Application ).AssemblyQualifiedName );
        }

        /// <summary>
        /// Toes the XML.
        /// </summary>
        /// <returns></returns>
        public string ToXml()
        {
            Serializer serializer = new Serializer();
            return serializer.SerializeObject( this, typeof( Application ) );
        }

        #endregion
    }
}